/**
 * 
 */
package com.hssoftvn.android.apps.tinycouplechat;

import android.graphics.drawable.Drawable;

/**
 * @author TinySon
 *
 */
public class ChatItem {
	String mPicture="";
	Drawable mAvatar;
	String mText="";
	int mType=Utils.TYPE_ME;
	int mStatus = Utils.SENDING_STATUS_SENDING;//Sending, Sent, Delivered, Seen
	public String mFromID="";
	public String mToID="";
	public String mSentTime="";
	public String mLocation="0,0";
	
	public ChatItem(String fromID, String pic, String message, int type)
	{
		mPicture = pic;
		mText = message;
		mAvatar = null;
		mType = type;
		mFromID = fromID;
	}
	public ChatItem(String fromID, Drawable pic, String message, int type)
	{
		mPicture = "";
		mAvatar = pic;
		mText = message;
		mType = type;
		mFromID = fromID;
	}

	/**
	 * @return the mPicture
	 */
	public String getPicturePath() {
		return mPicture;
	}
	public Drawable getDrawablePicture() {
		return mAvatar;
	}

	/**
	 * @param mPicture the mPicture to set
	 */
	public void setPicture(String mPicture) {
		this.mPicture = mPicture;
		
		try {
			mAvatar = Drawable.createFromPath(mPicture);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	}

	/**
	 * @return the mText
	 */
	public String getText() {
		return mText;
	}

	/**
	 * @param mText the mText to set
	 */
	public void setText(String mText) {
		this.mText = mText;
	}
	
	public boolean isLeftDisplayed()
	{
		return mType == Utils.TYPE_ME;
	}
	
	public boolean isRightDisplayed()
	{
		return mType == Utils.TYPE_YOU;
	}
	
	public void setStatus(int status)
	{
		mStatus = status;
	}
	public int getStatus()
	{
		return mStatus;				
	}
}
